<!--

    Copyright (c) 2015-2018 Red Hat, Inc.
    This program and the accompanying materials are made
    available under the terms of the Eclipse Public License 2.0
    which is available at https://www.eclipse.org/legal/epl-2.0/

    SPDX-License-Identifier: EPL-2.0

    Contributors:
      Red Hat, Inc. - initial API and implementation

-->
<dashboard-panel panel-title="Recent Factories">

  <md-progress-linear md-mode="indeterminate"
                      ng-show="lastFactoriesController.isLoading"></md-progress-linear>

  <div class="dashboard-last-factories" ng-show="!lastFactoriesController.isLoading">
    <div class="dashboard-add-button">
      <che-button-primary che-button-title="Create Factory"
                          ng-href="#/factories/create-factory"></che-button-primary>
    </div>

    <span ng-show="lastFactoriesController.getFactories().length === 0" class="last-factories-empty-label">No factories found</span>

    <che-list ng-show="lastFactoriesController.getFactories().length > 0">
      <cdvy-factory-item layout="row"
                         ng-repeat="factory in lastFactoriesController.getFactories() | orderBy:lastFactoriesController.factoriesOrderBy | limitTo:lastFactoriesController.maxItems"
                         cdvy-factory="factory"
                         cdvy-is-selectable="false"/>
    </che-list>
  </div>
</dashboard-panel>
